﻿<Controls:MetroWindow x:Class="EmailClient.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        Title="" Height="600" Width="800"
        EnableDWMDropShadow="True"
        ResizeMode="CanResizeWithGrip"
        WindowTransitionsEnabled="False"
        WindowStartupLocation="CenterScreen" Icon="/EmailClient;component/Images/head_icon_blue.ico">

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Resources/Icons.xaml"/>                
            </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </Window.Resources>

            <Controls:MetroWindow.LeftWindowCommands>
        <Controls:WindowCommands >
            <Button Click="miCreate_Click"
                    ToolTip="{DynamicResource TipButtonCreate}"
                    Content="{DynamicResource NameButtonCreate}"/>
            <Button Click="miDelete_Click"
                    ToolTip="{DynamicResource TipButtonDelete}"
                    Content="{DynamicResource NameButtonDelete}"/>
            <Button Click="miSearching_Click"
                    ToolTip="{DynamicResource TipSearchingButton}">
                <Rectangle Width="22"
                           Height="22"
                           Fill="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}">
                    <Rectangle.OpacityMask>
                        <VisualBrush Stretch="Uniform" Visual="{StaticResource appbar_magnify}" />
                    </Rectangle.OpacityMask>
                </Rectangle>
            </Button>
            <TextBox x:Name="tbStringSearch" MinWidth="150"/>
        </Controls:WindowCommands>
    </Controls:MetroWindow.LeftWindowCommands>
    <Controls:MetroWindow.RightWindowCommands>
        <Controls:WindowCommands>
            <Button Click="miSettingsAccounts_Click"
                    ToolTip="{DynamicResource TipButtonSettings}"
                    Content="{DynamicResource NameButtonSettings}" />
            <!--<Button Click="miAbout_Click"
                    ToolTip="{DynamicResource TipButtonAbout}"
                    Content="{DynamicResource NameButtonAbout}" />-->            
        </Controls:WindowCommands>
    </Controls:MetroWindow.RightWindowCommands>

    <DockPanel LastChildFill="True" >
        <Border Width="200" Background="White" BorderBrush="Black" BorderThickness="0.5" DockPanel.Dock="Left">
            <TreeView x:Name="tvBox" GotFocus="tvBox_GotFocus" SelectedItemChanged="tvBox_SelectedItemChanged" >
                <TreeView.Resources>
                    <ContextMenu x:Key="FolderContext"  StaysOpen="true">
                        <MenuItem x:Name="contMenuItemClear" Header="{DynamicResource NameContextMainMenuClear}" Click="contMenuItemClear_Click"/>                       
                    </ContextMenu>
                </TreeView.Resources>
                <TreeView.ItemTemplate>
                    <HierarchicalDataTemplate DataType="{x:Type MenuItem}" ItemsSource="{Binding Items}">
                        <TextBlock Text="{Binding Title}" />
                    </HierarchicalDataTemplate>
                </TreeView.ItemTemplate>                
            </TreeView>
        </Border>

        <Border Background="White" BorderBrush="Black" BorderThickness="0.5">
            <DataGrid x:Name="dgLetters" ItemsSource="{Binding}" AutoGenerateColumns="False" IsReadOnly="True" GridLinesVisibility="Horizontal" MouseDoubleClick="drLetters_MouseDoubleClick" LoadingRow="dgLetters_LoadingRow" FontWeight="Bold">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding FromSent}" Header="{DynamicResource NameMainGridFrom}"/>
                    <DataGridTextColumn Binding="{Binding Subject}" Header="{DynamicResource NameMainGridSubject}"/>
                    <DataGridTextColumn Binding="{Binding DepartureDate}" Header="{DynamicResource NameMainGridDepartureData}"/>               
                </DataGrid.Columns>
            </DataGrid>
        </Border>
    </DockPanel>
</Controls:MetroWindow>
